﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >

    <Style x:Key="CenterAlignCellStyle" TargetType="DataGridCell">
        <Setter Property="TextBlock.TextAlignment" Value="Center"/>
    </Style>

    <Style x:Key="RightAlignCellStyle" TargetType="DataGridCell">
        <Setter Property="TextBlock.TextAlignment" Value="Right"/>
    </Style>

    <Style x:Key="CenterAlignHeaderStyle" TargetType="DataGridColumnHeader">
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
    </Style>
    
    <Style x:Key="GroupItemStyle" TargetType="{x:Type GroupItem}">
        <Setter Property="Margin" Value="0,0,0,4"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type GroupItem}">
                    <Border BorderThickness="0,1,0,0" BorderBrush="LightGray">
                        <Expander IsExpanded="True">
                            <Expander.Header>
                                <TextBlock FontWeight="Bold" Text="{Binding Path=Name}" Margin="5,0,0,0" Foreground="DimGray" >
                                                <Run FontWeight="Normal" FontStyle="Italic" Text="{Binding Path=ItemCount, StringFormat=' ({0} items)', Mode=OneWay}" />
                                </TextBlock>
                            </Expander.Header>
                            <Expander.Content>
                                <ItemsPresenter />
                            </Expander.Content>
                        </Expander>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="DataGridStyle" TargetType="DataGrid">
        <Setter Property="AutoGenerateColumns" Value="False" />
        <Setter Property="SelectionUnit" Value="FullRow" />
        <Setter Property="SelectionMode" Value="Single" />
        <Setter Property="CanUserReorderColumns" Value="False" />
        <Setter Property="CanUserResizeRows" Value="False" />
        <Setter Property="HorizontalGridLinesBrush" Value="Whitesmoke" />
        <Setter Property="VerticalGridLinesBrush" Value="Whitesmoke" />
    </Style>
</ResourceDictionary>